﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ASmile.Event
{
    /// <summary>
    /// 事件订阅接口
    /// </summary>
    public interface IEventSubscribe
    {
        /// <summary>
        /// 该事件注册者的唯一Id，用于判断重复
        /// </summary>
        string ID { get; }
        /// <summary>
        /// 事件名称，用于触发
        /// </summary>
        string EventName { get; }
        /// <summary>
        /// 事件标题
        /// </summary>
        string EventCaption { get; }
        /// <summary>
        /// 事件执行顺序好，约大先执行
        /// </summary>
        int OrderNo { get; }
        /// <summary>
        /// 是否已被释放，释放后不再通知该订阅者
        /// </summary>
        bool IsDisposed { get; }
        /// <summary>
        /// 执行事件
        /// </summary>
        TriggerResult Execute(TriggerArg arg);

    }

    public interface IEventFormSubscribe : IEventSubscribe, IDisposable
    {
        event EventHandler Disposed;
    }
}
